﻿
@model Post

<div class="post">
	<div class="title">@Html.RouteLink( Model.Title, "ViewPost", new { slug = Model.Slug })</div>
	<div class="meta">		    
		@Strings.Post_PublishDate: @Html.DisplayFor( x => Model.PublishDate )
		@Strings.Post_Author: @Html.ActionLink(Model.Author.FullName, "Profile", new { controller = "Account", id = Model.Author.UserId })
	</div>
	<div class="meta">		
		@if (Model.Categories.Any()) { 
			@(Strings.Categories)<text>:</text>
			foreach (var category in Model.Categories) {
				@Html.RouteLink(category.Name, "ViewCategory", new { name = category.Name })
			}
		}
		@if( Model.Tags.Any() ) { 
			@(Strings.Tags)<text>:</text>
			foreach (var tag in Model.Tags){ 
				@Html.RouteLink(tag.Name, "ViewTag", new { name = tag.Name })
			}
		}
	</div>  
	<div class="entry">@Html.Raw(Model.Content)</div>
	<div class="post_rating">@Html.Ratings(Model)</div>
	<div class="post_footer">			
		<div>			
			@if (Model.AreCommentsEnabled) {           						
				@Html.RouteLink(Strings.Comments, "ViewPost", "", "", "Comments", new { slug = Model.Slug }, null)	            
				@( Model.ApprovedComments.Any() ? " (" + Model.ApprovedComments.Count() + ")" : "" )<span> | </span>	
			}
											
			@if ( User.CanEditPost( ViewData.Model )) {
				@Html.ActionLink(Strings.Edit, "Edit", "Post", new { id = Model.PostId}, null )
			}       
		</div>
		<div style="float:right">
			@if (SiteConfiguration.SocialNetworkingSupport)
			{
				Html.RenderPartial("Share", Model );
			}
		</div>
	</div>	
</div>